// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/base/api/OpLogRuntimeApi'

import ComClass from '@api/ComQuery'
import ListClass from '@api/base/model/OpLogRuntimeListReq'

const CLIENT = CORE.grpcCLIENT(Client)

const COM = [ComClass, 'comQuery']

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 列表 —————————————————————————————— //

  async getList(param, TIP = '查询列表') {
    const DTO = CORE.grpcDTO(ListClass, param, COM)
    const resp = await CORE.grpc(TIP, CLIENT, 'list', DTO)
    return [resp.comQuery.totalCount, resp.logs || []]
  },
}
